<?php include_partial('genericComponent/rightTitle', array('title' => 'derniers commentaires')); ?>

<ul id="last-comments">
    <?php
        $link_html = "";
        $array_record_id = array('News' => null, 'Event' => null);
        foreach($last_comments_list as $comment){
            $contentLink  = '<span class="author">Le ' . date("d/m/Y", strtotime($comment[ 'updated_at' ]));
            $contentLink .= ' par ' . ($comment[ 'username' ] ? $comment[ 'username' ] : $comment[ 'author_name' ]) . '</span>';

            $contentLink .= '<span class="description">' . truncate_text(strip_tags($comment->getRaw('body')), 100, '...') . '</span>';

            $link = get_partial('lastComments/linkComment', array('comment' => $comment));
            $link_html = link_to($contentLink, $link);
        ?>
            <li>
                <?php echo $link_html ?>
            </li>
    <?php }?>
</ul>
<div class="push_float"></div>
<p class="link_last_comments">Retrouvez tous <?php echo link_to('les derniers commentaires de CPF Aizenay', '@last_comments', array('class' => 'link_last_comments')) ?></p>